﻿using System;
using Demo.Api.Entities;

namespace Demo.Api.Models
{
    /// <summary>
    /// 流程经过点
    /// </summary>
    public class FlowChartProcessDto
    {
        /// <summary>
        ///     事项Id
        /// </summary>
        public long AffairId { get; set; }

        /// <summary>
        ///     事项实例Id
        /// </summary>
        public long AffairProcessId { get; set; }

        /// <summary>
        ///     流程Id
        /// </summary>
        public long FlowChartId { get; set; }

        /// <summary>
        ///     节点Id
        /// </summary>
        public long NodeId { get; set; }

        /// <summary>
        ///     规则Id
        /// </summary>
        public long RuleId { get; set; }

        /// <summary>
        ///     节点类型
        /// </summary>
        public int NodeType { get; set; }
        /// <summary>
        ///     结果类型
        /// </summary>
        public int OperatingNodeType { get; set; }

        /// <summary>
        ///     操作时间
        /// </summary>
        public DateTime OperatingTime { get; set; }

        public FlowChartProcessDo To()
        {
            return new FlowChartProcessDo
            {
                AffairId = AffairId,
                FlowChartId = FlowChartId,
                AffairProcessId = AffairProcessId,
                NodeId = NodeId,
                NodeType = NodeType,
                OperatingNodeType = OperatingNodeType,
                OperatingTime = OperatingTime,
                RuleId = RuleId
            };
        }
    }
}